﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="manager_list.aspx.cs" Inherits="YULI.Web.admin.manager.manager_list" ValidateRequest="false" %>

<%@ Import Namespace="YULI.Common" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>管理员列表-<%=config.webname%></title>
    <link href="/scripts/layui/css/layui.css" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="/css/pagination.css" />
    <link href="../css/shop.css" type="text/css" rel="stylesheet" />
    <link href="/css/Sellerber.css" type="text/css" rel="stylesheet" />
    <link href="../css/bkg_ui.css" type="text/css" rel="stylesheet" />
    <link href="../font/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <script src="/scripts/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/scripts/Validform/Validform.min.js"></script>
    <script type="text/javascript" src="/scripts/jquery/jquery.cookie.js"></script>
    <script src="../js/shopFrame.js" type="text/javascript"></script>
    <script src="/scripts/jquery/Sellerber.js" type="text/javascript"></script>
    <script src="/scripts/layer/layer.js" type="text/javascript"></script>
    <script src="../../scripts/layui/layui.all.js" type="text/javascript"></script>
    <script src="../js/common/function.js" type="text/javascript"></script>
    <script type="text/javascript">
        function EditManager(title, url) {
            layer.open({
                type: 2,
                title: title,
                area: ['700px', '630px'],
                fixed: false, //不固定
                //maxmin: true,
                content: url
            });
        }

        function EditStatus(adminId, statusIdNow) {
            if (adminId <= 0 || statusIdNow <= 0) {
                layer.alert('参数有误！', {
                    title: '提示',
                    icon: 0,
                });
                return false;
            }
            $.ajax({
                type: "POST",
                url: "/tools/admin_ajax.ashx?action=edit_admin_status",
                dataType: "json",
                data: {
                    "AdminID": adminId,
                    "StatusID": statusIdNow
                },
                timeout: 20000,
                beforeSend: function (XMLHttpRequest) {
                    //
                },
                success: function (data, textStatus) {
                    if (data.status == 1) {
                        layer.alert(data.msg, { icon: 1 }, function (index) {
                            location.reload();
                        });

                    } else {
                        layer.alert(data.msg, {
                            title: '提示',
                            icon: 0,
                        });
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    layer.alert("状态：" + textStatus + "；出错提示：" + errorThrown, {
                        title: '提示',
                        icon: 2,
                    });
                }
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div class="margin Competence_style" id="page_style">
            <div class="operation clearfix">
                <a href="javascript:ovid()" onclick="EditManager('添加管理员','manager_edit.aspx?action=<%#YULIEnums.ActionEnum.Add%>')" class="btn button_btn bg-deep-blue"><i class="fa  fa-edit"></i>&nbsp;添加管理员</a>
                <asp:LinkButton ID="btnDelete" runat="server" OnClientClick="return ExePostBack('btnDelete');" OnClick="btnDelete_Click" CssClass="btn button_btn btn-danger"><i class="fa fa-trash-o"></i><span>&nbsp;删除</span></asp:LinkButton>
                <div class="search  clearfix">
                    <asp:TextBox ID="txtKeywords" runat="server" CssClass="form-control col-xs-8" />
                    <asp:LinkButton ID="lbtnSearch" runat="server" CssClass="btn button_btn bg-deep-blue" OnClick="btnSearch_Click"><i class="fa  fa-search"></i>搜索</asp:LinkButton>
                </div>
            </div>
            <div class="compete_list">
                <table class="table table_list table_striped table-bordered dataTable no-footer">
                    <asp:Repeater ID="rptList" runat="server">
                        <HeaderTemplate>
                            <thead>
                                <tr>
                                    <th class="center" style="width: 80px;">
                                        <a href="javascript:;" onclick="checkAll(this);"><i class="ace"></i><span>全选</span></a>
                                    </th>
                                    <th>用户名</th>
                                    <th>角色</th>
                                    <th>姓名</th>
                                    <th>电话</th>
                                    <th>邮箱</th>
                                    <th class="hidden-480">加入时间</th>
                                    <th>状态</th>
                                    <th>信息待审</th>
                                    <th style="width: 200px;">操作</th>
                                </tr>
                            </thead>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tbody>
                                <tr>
                                    <td class="center">
                                        <asp:CheckBox ID="chkId" CssClass="ace checkall" runat="server" />
                                        <asp:HiddenField ID="hidId" Value='<%#Eval("id")%>' runat="server" />
                                    </td>
                                    <td><%# Eval("user_name") %></td>
                                    <td><b><%#new YULI.BLL.manager_role().GetTitle(Convert.ToInt32(Eval("role_id")))%></b></td>
                                    <td><%# Eval("real_name") %></td>
                                    <td><%# Eval("telephone") %></td>
                                    <td><%# Eval("email") %></td>
                                    <td><%#string.Format("{0:g}",Eval("add_time"))%></td>
                                    <td class="td-status"><%#Eval("is_lock").ToString().Trim() == "0" ? "<span class=\"label label-success label-sm\">已启用</span>" : "<span class=\"label label-error label-sm\">已停用</span>"%></td>
                                    <td class="td-status"><%#Eval("is_audit").ToString().Trim() == "1" ? "<span class=\"label label-success label-sm\">需要</span>" : "<span class=\"label label-error label-sm\">不需要</span>"%></td>
                                    <td class="td-manage">
                                        <a onclick="EditStatus('<%#Eval("id")%>','<%#Eval("is_lock")%>')" href="javascript:;" class="btn button_btn btn-Dark-success"><%#Eval("is_lock").ToString().Trim() == "0" ? "禁用" : "启用"%></a>
                                        <a href="javascript:ovid()" onclick="EditManager('修改管理员','manager_edit.aspx?action=<%#YULIEnums.ActionEnum.Edit%>&id=<%#Eval("id")%>')" class="btn button_btn bg-deep-blue">编辑</a>
                                    </td>
                                </tr>
                            </tbody>
                        </ItemTemplate>
                        <FooterTemplate>
                            <%#rptList.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"10\">暂无记录</td></tr>" : ""%>
  </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </table>
            </div>
            <div class="pagelist">
                <div class="l-btns">
                    <span>显示</span><asp:TextBox ID="txtPageNum" runat="server" CssClass="pagenum" onkeydown="return checkNumber(event);"
                        OnTextChanged="txtPageNum_TextChanged" AutoPostBack="True"></asp:TextBox><span>条/页</span>
                </div>
                <div id="PageContent" runat="server" class="manu" style="font-size: 16px; margin: 2px 5px 0 -1px; font-family: 微软雅黑; float: left;"></div>
            </div>
        </div>
    </form>
</body>
</html>
